package com.ruoyi.system.service.impl;

import com.ruoyi.common.annotation.DataSource;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.enums.DataSourceType;
import com.ruoyi.system.domain.VehicleValueData;
import com.ruoyi.system.mapper.VehicleValueDataMapper;
import com.ruoyi.system.service.IVehicleValueDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 车辆Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-10-01
 */
@Service
@DataSource(value = DataSourceType.SLAVE)
public class VehicleValueDataServiceImpl implements IVehicleValueDataService 
{
    @Autowired
    private VehicleValueDataMapper vehicleValueDataMapper;

    /**
     * 查询车辆
     * 
     * @param vehicleId 车辆主键
     * @return 车辆
     */
    @Override
    public VehicleValueData selectVehicleValueDataByVehicleId(Integer vehicleId)
    {
        return vehicleValueDataMapper.selectVehicleValueDataByVehicleId(vehicleId);
    }

    /**
     * 查询车辆列表
     * 
     * @param vehicleValueData 车辆
     * @return 车辆
     */
    @Override
    public List<VehicleValueData> selectVehicleValueDataList(VehicleValueData vehicleValueData)
    {
        return vehicleValueDataMapper.selectVehicleValueDataList(vehicleValueData);
    }

    @Override
    public List<VehicleValueData> selectCount6DataList(VehicleValueData vehicleValueData) {
        return vehicleValueDataMapper.selectCount6DataList(vehicleValueData);
    }

    /**
     * 新增车辆
     * 
     * @param vehicleValueData 车辆
     * @return 结果
     */
    @Override
    public int insertVehicleValueData(VehicleValueData vehicleValueData)
    {
        return vehicleValueDataMapper.insertVehicleValueData(vehicleValueData);
    }

    /**
     * 修改车辆
     * 
     * @param vehicleValueData 车辆
     * @return 结果
     */
    @Override
    public int updateVehicleValueData(VehicleValueData vehicleValueData)
    {
        return vehicleValueDataMapper.updateVehicleValueData(vehicleValueData);
    }

    /**
     * 批量删除车辆
     * 
     * @param vehicleIds 需要删除的车辆主键
     * @return 结果
     */
    @Override
    public int deleteVehicleValueDataByVehicleIds(String vehicleIds)
    {
        return vehicleValueDataMapper.deleteVehicleValueDataByVehicleIds(Convert.toStrArray(vehicleIds));
    }

    /**
     * 删除车辆信息
     * 
     * @param vehicleId 车辆主键
     * @return 结果
     */
    @Override
    public int deleteVehicleValueDataByVehicleId(Integer vehicleId)
    {
        return vehicleValueDataMapper.deleteVehicleValueDataByVehicleId(vehicleId);
    }
}
